package com.dream.keigezhushou.Activity.kege.acty;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.Uiutils.UiUtils;
import com.dream.keigezhushou.Activity.pop.FinishSaveWindow;
import com.dream.keigezhushou.Activity.pop.FinishWindow;
import com.dream.keigezhushou.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SingingFinishActivity extends AppCompatActivity {


    @BindView(R.id.ib_return)
    ImageView returnBtn;

    @BindView(R.id.singing_finish_chongchang)
    TextView chongChangTv;

    @BindView(R.id.singing_finish_fabu)
    LinearLayout faBuTv;

    @BindView(R.id.singing_finish_save)
    TextView saveTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_singing_finish);
        ButterKnife.bind(this);

        setOnClick();

    }


    public void setOnClick() {

        returnBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


        chongChangTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FinishWindow finishWindow = new FinishWindow(View.inflate(SingingFinishActivity.this, R.layout.pop_window_finish, null), SingingFinishActivity.this, (int) (UiUtils.getWidth() * 0.65), ViewGroup.LayoutParams.WRAP_CONTENT);
                finishWindow.showPopAtLocation(v, Gravity.CENTER);
                finishWindow.setItemListener(new FinishWindow.ItemClickListener() {
                    @Override
                    public void onMakeSure() {
                        UiUtils.toast("确定");
                    }
                });

            }
        });


        faBuTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent = new Intent();
                intent.setClass(SingingFinishActivity.this, ReleaseActivity.class);
                startActivity(intent);


            }
        });


        saveTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                FinishSaveWindow finishSaveWindow = new FinishSaveWindow(View.inflate(SingingFinishActivity.this, R.layout.pop_window_save_finish, null), SingingFinishActivity.this, (int) (UiUtils.getWidth() * 0.65), ViewGroup.LayoutParams.WRAP_CONTENT);
                finishSaveWindow.showPopAtLocation(v, Gravity.CENTER);
                finishSaveWindow.setItemListener(new FinishSaveWindow.ItemClickListener() {
                    @Override
                    public void onMakeSure() {
                        UiUtils.toast("确定");
                    }
                });
            }
        });


    }


}
